<%-- 
    Document   : delete
    Created on : Apr 7, 2011, 10:20:22 AM
    Author     : Noi Nho
--%>

<%@page import="dto.User"%>
<%@page import="dao.UserDAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
c:if test="${param['username']=='' || param['username']==null}">
<jsp:forward page="administrator.jsp?page=user" />
</c:if>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Delete User</title>
    </head>
    <body>
        <a href="administrator.jsp?page=user">User management</a>
        <form action="AdminAction?page=user&action=delete&username=${param['username']}" name="deleteUser" method="post">
            <%
                        UserDAO userDAO = new UserDAO();
                        User user = userDAO.getUserByUserName(request.getParameter("username").toString());
                        if (user != null) {
                            request.setAttribute("user", user);
            %>
            Username: <%out.println(user.getUsername());%>
            Role No: <%out.println(user.getRoleNo());%>
            <br>
            Status: <%out.println(user.isStatus());%>
            <br>
            <input type="submit" name="submit" value="Ok">
            <input type="reset" name="reset" value="reset">
            <%
                        }
            %>
        </form>
    </body>
</html>
